package masterjava.soa.smsgate;

import masterjava.common.configuration.Setting;
import masterjava.common.property.Property;

import java.net.URL;

import static masterjava.soa.smsgate.SmsGateSetting.PROPS.*;

/**
 * MasterJava.ru
 * <p/>
 * User: GKislin
 * Date: 31-Jan-2011
 */
public class SmsGateSetting extends Setting {
    static final String PROPERTY_FILE_NAME = "smsGate.properties";

    enum PROPS {
        url, login, password, ejbProvider
    }

    public final Property<URL> URL;

    public final Property<String> LOGIN;

    public final Property<String> PASSWORD;

    public final Property<String> EJB_PROVIDER;

    public SmsGateSetting() {
        super(PROPERTY_FILE_NAME);
        initPropStore();
        URL = createProp(url, URL.class);
        LOGIN = createProp(login);
        PASSWORD = createProp(password);
        EJB_PROVIDER = createProp(ejbProvider);
    }

    public static SmsGateSetting get() {
        return get(PROPERTY_FILE_NAME, SmsGateSetting.class);
    }
}
